﻿using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DevSamPle.FormPlugin
{
    [Description("【表单插件】BeforeUpdateValue 字段更新前事件，示例禁止某些用户更改某些字段"), HotUpdate]
    public class CustBeforeUpdateValue: AbstractDynamicFormPlugIn
    {
        public override void BeforeUpdateValue(BeforeUpdateValueEventArgs e)
        {
            base.BeforeUpdateValue(e);
            if (this.Context.UserName == "demo" && e.Key.EqualsIgnoreCase("FQty"))
            {
                e.Cancel = true;
                this.View.ShowErrMessage("当前用户禁止输入修改数量！");
            }
        }
    }
}
